package com.guomao.filedemos;

import java.io.File;
import java.io.FileFilter;
import java.util.Arrays;

public class FileDemoJ {


    public static void main(String[] args) {

        File file = new File("D://");
        File[] files = file.listFiles(new FileFilter() {
            public boolean accept(File f) {
                return f.getName().endsWith(".java");
            }
        });

        System.out.println(Arrays.toString(files));
    }

}
